﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta charset="utf-8">
    <title>btable</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

   <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="css/btable.css" />
	<link href="css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
    <script src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
    $(document).ready(function() {
		var url = "<%=request.getContextPath()%>/chongzhihui.do";
		$.post(
			//路径
			url,
			$("form").serialize(),
			//回调函数
			function(data) {
				if(data=="0"){
					alert("请将个人信息填写完整！");
				}else {
					var url = "<%=request.getContextPath()%>/chongzhihui2.do";
					$.post(
							//路径
							url,
							$("form").serialize(),
							//回调函数
							function(data) {
								$("#unamename").val(data.unamename);
								$("#ucard").val(data.ucard);
								$("#upassword1").val(data.upassword);
								$("#yinmount1").val(data.yinmount);
							},
							//返回类型
							"json"
						); 
				}
			},
			//返回类型
			"json"
		);
	});
    function fang() {	
		var upassword=$("#upassword").val();
		var upassword1=$("#upassword1").val();
		var jine=$("#jine").val();
		if(upassword!=upassword1){
			alert("密码错误！");
		}else if(jine==null){
			alert("请输入金额！");
		}else{
			var url = "<%=request.getContextPath()%>/chongzhi.do";
			$.post(
				//路径
				url,
				$("form").serialize(),
				//回调函数
				function(data) {
					if(data=="ok"){
						alert("充值成功");
					}else{
						alert("充值失败");
					}
				}
			);
			alert("充值成功");
		} 
	}

    </script>
</head>

<body style=" background-color: gainsboro;">

   <div style="margin:0px; background-color: white; margin:0 10px;">
        <div id="content" style="width: 100%;height: 533px;">
			<!-- 搭建显示页面 -->
		<div class="container">
	
		<div class="row">
			<h1 align="center">个人详细信息</h1>
		</div>
		<!-- 显示表格数据 -->
		<div class="row">
			<div class="col-md-12">
				<form action="" method="post">
				<table class="table table-hover">
					<tr>
						<td>用户名：</td><!-- readonly="readonly" disabled="disabled" -->
						<td><input type="text" id="unamename" readonly="readonly"  name="unamename" value=""/>
							<input type="hidden" id="yinmount1" name="yinmount" value="" />
						</td>
						
					</tr>
					<tr>	
						<td>银行卡号：</td>
						<td><input type="text" id="ucard" readonly="readonly" name="ucard" value=""/></td>
					</tr>
					<tr>
						<td>密码：</td>
						<td>
							<input type="password" id="upassword"   name="upassword" value=""/>
							<input type="hidden" id="upassword1"  name="upassword1" value=""/>
						</td>
					</tr>
					<tr>
						<td>充值金额：</td>
						<td>
							<input type="text" id="jine" name="jine" value=""/>
						</td>
					</tr>
					<tr>
						<td colspan="2" align="center">
							<button class="btn btn-primary btn-sm" onclick="fang()">充值</button>
						</td>
					</tr>
				</table>

				</form>
			</div>
		</div>
        </div>
		</div>
    </div>
</body>

</html>